<include file="__PUBLIC__/_header"/>
<body>
<div class="navbar navbar-default" id="navbar">
    <script type="text/javascript">
        try{
            ace.settings.check('navbar' , 'fixed')
        }catch(e){

        }
    </script>
    <include file="__PUBLIC__/_header_title"/><!-- /.container -->
</div>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{
            ace.settings.check('main-container' , 'fixed')
        }catch(e){

        }
    </script>

    <div class="main-container-inner">
        <a class="menu-toggler" id="menu-toggler" href="#">
            <span class="menu-text"></span>
        </a>

        <div class="sidebar" id="sidebar">
            <script type="text/javascript">
                try{
                    ace.settings.check('sidebar' , 'fixed')}catch(e){
                }
            </script>
            <include file="__PUBLIC__/_nav"/>
            <!-- /.nav-list -->
        </div>
        <div class="main-content">
            <div class="breadcrumbs" id="breadcrumbs">
                <script type="text/javascript">
                    try{
                        ace.settings.check('breadcrumbs' , 'fixed')
                    }catch(e){
                    }
                </script>
                <ul class="breadcrumb">
                    <li>
                        <i class="icon-home home-icon"></i>
                        <a href="{:Controller::_createUrl('index/index')}">首页</a>
                    </li>
                    <li class="active"> 促销管理 </li>
                    <li class="active"> 促销列表</li>
                </ul><!-- .breadcrumb -->
            </div>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <form id="search-box" data-id="12ea1025df5187e3afb9b39f4437f308" class="form-horizontal form-actions" action="{:Controller::_createUrl('promotion/list')}" method="get" style="padding-left: 0px; margin-top: 40px;">
                            <div id="myTabContent" class="tab-content" style="margin:0 10px 10px 10px;padding: 10px;">
                                <div class="tab-pane fade in active" id="filter">
                                    <ul>
                                        <li class="pull-left link-item col-xs-6 col-sm-12 text-left " style="list-style: none">
                                            <div class="pull-left col-xs-1  col-sm-2">
                                                <label for="account_name">商品货号</label>
                                            </div>
                                            <div class=" pull-left text-left col-xs-2  col-sm-6">
                                                <div class="input-group">
                                                    <span class="input-group-addon icon-font"></span>
                                                    <input type="text" class="text-center field-edit type4" placeholder="" data-m="" data-id="" name="keyword" id="account_name" value="" />
                                                </div>
                                            </div> </li>
                                        <div class="row" style="margin-left: 30px;padding-top: 20px;">
                                            <button style="margin-top: 20px;" type="submit" class="btn btn-success icon-search">查询</button>
                                            <button style="margin-top: 20px;" type="reset" class="btn btn-refresh icon-refresh">清除</button>
                                        </div>
                                    </ul>
                                </div>
                            </div>
                            <input type="hidden" name="search" value="1" />
                        </form>
                    </div>
                    <div class="col-xs-12">
                        <div class="tabbable">

                            <div class="tab-content no-border padding-24">

                                <div class="table-responsive">
                                    <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                        <thead>
                                        <tr>
                                            <th class="center"></th>
                                            <th>商品货号</th>
                                            <th>促销价格</th>
                                            <th>状态</th>
                                            <th>截至时间</th>
											<th>促销类别</th>
											<th>促销描述</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <volist name="list" id="vo">
                                            <tr>
                                                <th class="center">
                                                    <label>
                                                        <input type="checkbox" name="chk" value="{$vo.item_no}" class="ace" />
                                                        <span class="lbl"></span>
                                                    </label>
                                                </th>
                                                <td class="center">
                                                    {$vo.item_no}
                                                </td>
                                                <td>
                                                    {$vo.price}
                                                </td>
                                                <td>
                                                    <if condition="$vo.state eq 0">
                                                        下架
                                                        <else/>
                                                        上架
                                                    </if>
                                                </td>
                                                <td>
                                                    {$vo.m_deliver_limit_time}
                                                </td>
                                                <td>
                                                    {$vo.kind_id|getPromotionTitle}
                                                </td>
                                                <td>
                                                    {$vo.desc}
                                                </td>
												<td>
													<a onclick="return confirm('确认删除吗？');" href="{:Controller::_createUrl('promotion/delete',array('item_no'=>$vo['item_no']))}">删除</a>
                                                </td>
                                            </tr>
                                        </volist>
                                        <tr>
                                            <td colspan="13">
                                                <a class="dialogBtn" href="{:Controller::_createUrl('promotion/add',$_GET)}/type/1" class="tooltip-success" data-rel="tooltip" title="" title="Edit">

                                                <span>
                                                    <i class="icon-plus bigger-120"></i>
                                                </span>

                                                    添加
                                                </a>

                                                <a  href="{:Controller::_createUrl('promotion/deleteAll',$_GET)}/type/1" class="tooltip-success" data-rel="tooltip" title="" title="Edit">
                                                <span>
                                                    <i class="icon-trash bigger-120"></i>
                                                </span>
                                                    清空
                                                </a>

                                                <a class=" delAll" href="javascript:void(0)" class="tooltip-success" data-rel="tooltip" title="" title="Edit">
                                                    <span>
                                                        <i class="icon-trash bigger-120"></i>
                                                    </span>
                                                    删除
                                                </a>

                                                <ul class="pagination" style="float: right">
                                                    {$pager_html}
                                                </ul>
                                            </td>
                                        </tr>
                                        </tbody>
                                        <tfoot>
                                        </tfoot>

                                    </table>
                                </div><!-- /.table-responsive -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
    <i class="icon-double-angle-up icon-only bigger-110"></i>
</a>
<link href="__SKIN__/js/colorbox/colorbox.css" rel="stylesheet" type="text/css">
<script src="__SKIN__/js/colorbox/colorbox.js" type="text/javascript"></script>
<script>
    $(document).ready(function(){
	
        $(".dialogBtn").colorbox({iframe:true, width:"55%", height:"70%"});
        $(".delAll").click(function(){
            var item_nos = '';
            $("input[name=chk]").each(function(i,v){
                if($(v).val()){
                    item_nos += ','+$(v).val();
                }
            })
            alert(item_nos);
        })
    })
</script>
</body>
</html>
